Visual Studio builds: Adapt to new glib-mkenums
authorChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 1 Aug 2017 08:05:57 +0000 (16:05 +0800)
committerChun-wei Fan <fanchunwei@src.gnome.org>
Tue, 1 Aug 2017 08:26:43 +0000 (16:26 +0800)
commitffc15bf9221af662277c36e4a36b3f7a30487bd2
tree5e75e324aaa0b0cd652e8c9cd8243945feee58fe
parente74be1728e21c04ff044a5ee33af855c6714bbe7
Visual Studio builds: Adapt to new glib-mkenums

glib-mkenums is now done in Python, but since the Visual Studio build
environment (cmd.exe) does not support shebang lines, we need to call
the interpretor explicitly to run the script.

This means that we need to update on how we generate
gsk/gskenumtypes.[c|h] in our projects, as at this point GTK+-3.91.x
does not require a GLib installation that ships with the Python-fied
glib-mkenums.  As a result, we adapt to this by first using Python
to call glib-mkenums.  If this fails (where the output file becomes 0
in size), then we use PERL to call the glib-mkenums script.  Note that
during the build this will cause a warning message to be displayed,
stating that '&' cannot be found, but due to the way Windows .bat script
are done, we need to live with that until a solution can be found on
this.

This is likely a problem that does not exist in the Meson builds, as
Meson will take care of calling the interpretor for us by looking at
the shebang lines for our case.

Also, clean up the .batin Windows batch script that is used to call
glib-mkenums by using a for loop in there.
win32/gen-enums.batin
win32/vs12/gsk-4.vcxprojin
win32/vs12/gtk4-gen-srcs.props